/* Turska UI library
 * Copyright 2003-2008 Jetro Lauha
 * All rights reserved.
 * Web: http://iki.fi/jetro/
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of EITHER:
 *   (1) The GNU Lesser General Public License as published by the Free
 *       Software Foundation; either version 2.1 of the License, or (at
 *       your option) any later version. The text of the GNU Lesser
 *       General Public License is included with this library in the
 *       file LICENSE-LGPL.txt.
 *   (2) The BSD-style license that is included with this library in
 *       the file LICENSE-BSD.txt.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
 * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
 *
 * $Id: UISlider.h,v 1.2 2008/03/27 11:44:25 tonic Exp $
 * $Revision: 1.2 $
 */

#ifndef UISLIDER_H_INCLUDED
#define UISLIDER_H_INCLUDED


class UISlider : public UIButton
{
public:

    enum ORIENTATION
    {
        HORIZONTAL = 0,
        VERTICAL
    };

    UISlider(INT x, INT y, UIImage *image = NULL, UIImage *thumbImage = NULL,
             UINT orientation = HORIZONTAL, double value = 0,
             INT minPosition = -1, INT maxPosition = -1);
    virtual ~UISlider() {}

    void setImage(UIImage *image) { setDefaultImage(image); }
    void setThumbImage(UIImage * image) { setSymbolImage(image); }
    UIImage * getImage() { return getDefaultImage(); }
    UIImage * getThumbImage() { return getSymbolImage(); }

    void setPosition(INT position);
    void setMinPosition(INT minPosition) { mMinPosition = minPosition; }
    void setMaxPosition(INT maxPosition) { mMaxPosition = maxPosition; }
    INT getPosition() { return mPosition; }
    INT getMinPosition() { return mMinPosition; }
    INT getMaxPosition() { return mMaxPosition; }

    void setValue(double value);
    double getValue();

    virtual void onPointerDown(INT x, INT y);
    virtual void onPointerUp(INT x, INT y);
    virtual void onPointerMove(INT x, INT y);

    virtual void draw();

private:

    INT mPosition, mMinPosition, mMaxPosition;
    UINT mOrientation;
};


#endif // !UISLIDER_H_INCLUDED
